package com.lemon.stock.dao

import androidx.room.*
import com.lemon.stock.entity.Stock

@Dao
interface StockDao {
    @Query("SELECT * FROM stock Where follow=8")
    fun followStocks(): List<Stock>

    @Query("SELECT * FROM stock")
    fun allStocks(): List<Stock>

    @Query("SELECT * FROM stock WHERE status>4")
    fun optionStocks(): List<Stock>

    @Query("SELECT * FROM stock WHERE stock_id = :id ")
    fun findById(id: String): Stock

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(vararg stock: Stock)

    @Update
    fun update(vararg stock: Stock)
}